from django.db import models
from company.models import Basic as CompanyBasic
class Basic(models.Model):
	id= models.AutoField(primary_key=True)
	code=models.CharField(max_length=8)
	name=models.CharField(max_length=64)
	currency=models.CharField(max_length=4)

class IND(models.Model):
	id= models.AutoField(primary_key=True)
	exchange=models.ForeignKey( Basic, models.SET_NULL,null=True,)
	symbol=models.CharField(max_length=8)
	name=models.CharField(max_length=32)
	precision=models.SmallIntegerField()
	
class CBD(models.Model):
	id= models.AutoField(primary_key=True)
	exchange=models.ForeignKey( Basic, models.SET_NULL,null=True,)
	symbol=models.CharField(max_length=8)
	company=models.ForeignKey( CompanyBasic, models.SET_NULL,null=True,)
	name=models.CharField(max_length=32)
	order_min=models.SmallIntegerField()
	precision=models.SmallIntegerField()
class STK(models.Model):
	id= models.AutoField(primary_key=True)
	exchange=models.ForeignKey( Basic, models.SET_NULL,null=True,)
	symbol=models.CharField(max_length=8)
	company=models.ForeignKey( CompanyBasic, models.SET_NULL,null=True,)
	name=models.CharField(max_length=32)
	order_min=models.SmallIntegerField()
	precision=models.SmallIntegerField()
class ETF(models.Model):
	id= models.AutoField(primary_key=True)
	exchange=models.ForeignKey( Basic, models.SET_NULL,null=True,)
	symbol=models.CharField(max_length=8)
	name=models.CharField(max_length=32)
	order_min=models.SmallIntegerField()
	precision=models.SmallIntegerField()
	
class Unknown(models.Model):
	id= models.AutoField(primary_key=True)
	exchange=models.ForeignKey( Basic, models.SET_NULL,null=True,)
	symbol=models.CharField(max_length=8)
	company=models.ForeignKey( CompanyBasic, models.SET_NULL,null=True,)
	name=models.CharField(max_length=32)
	order_min=models.SmallIntegerField()
	precision=models.SmallIntegerField()
	
